/**
 * 
 */
package au.edu.swin.videoshop.bean;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author julie
 *
 */
public class AddressState implements Serializable {
	private static final Map sMap = new HashMap();
	
	public static final AddressState NSW = new AddressState("NSW", "New South Wales");
	public static final AddressState VIC = new AddressState("VIC", "Victoria");
	public static final AddressState SA = new AddressState("SA", "South Australia");
	public static final AddressState WA = new AddressState("WA", "Western Australia");
	public static final AddressState NT = new AddressState("NT", "Nothern Teritory");
	public static final AddressState ACT = new AddressState("ACT", "Australia Capital Teritory");
	public static final AddressState TAS = new AddressState("TAS", "Tasmania");
	
	private String mName;
	private String mDescription;
	
	private AddressState(String name, String description) {
		mName = name;
		mDescription = description;
		
		sMap.put(name, this);
	}
	
	/**
	 * @return the name
	 */
	
	public String getName() {
		return mName;
	}
	
	/**
	 * @return the description
	 */
	public String getDescription() {
		return mDescription;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return mName;
	}
	
	public static AddressState getInstance(String name) {
		return (AddressState)sMap.get(name);
	}
}
